import Home from '../pages/Home'
import Login from '../pages/Login'
import Register from '../pages/Register'
import Search from '../pages/Search'
import Detail from '../pages/Detail'
import AddCartSuccess from '../pages/AddCartSuccess'
import ShopCart from '../pages/ShopCart'

export const routes =  [
    {
        name:'Home',
        path:'/home',
        component:Home,
        meta: {
          isHiddenNav: true
        }
    },
    {
        name:'Login',
        path:'/login',
        component:Login,
        meta:{
          isHiddenFooter:true
        }
    },
    {
        name:'Register',
        path:'/register',
        component:Register,
        meta:{
          isHiddenFooter:true
        }
    },
    {
        name:'Search',
        path:'/search',
        component:Search,
    },
    {
        name:'Detail',
        path:'/detail/:id',
        component:Detail,
        props:true //加入这行代码，可以保证对应组件中用props来接收params参数
    },
    {
        name:'AddCartSuccess',
        path:'/addCartSuccess',
        component:AddCartSuccess
    },
    {
        name:'ShopCart',
        path:'/shopCart',
        component:ShopCart,
    },
    {
        path:'/', //设置默认页面
        redirect:'/home'
    }
]